home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / AIncludes / FSEqu.a < prev    next >
Encoding:
Text File  |  1989-10-13  |  13.0 KB  |  288 lines  |  [TEXT/MPS ]

  1. ; Version: 2.2
  2. ; Created: Wednesday, July 5, 1989 at 4:17:30 PM
  3. ;
  4. ; File: FSEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1984-1989
  8. ; All Rights Reserved
  9. ;
  10. ;--------------------------------------------------------------------
  11. SigWord         EQU         $D2D7                    ; signature bytes (MFS volume)
  12. TSigWord        EQU         $4244                    ; signature bytes (HFS volume)
  13. HFSBit            EQU         9                        ; defines HFS bit in trap word
  14. ;_______________________________________________________________________
  15. ; fixed location labels: (equivalent of zero page)
  16. FSFCBLen        EQU         $3F6                    ; HFS present flag / FCB size (-1 in old ROM)
  17. WDRfnMin        EQU         -32767                    ; Lowest assigned WD RefNum
  18. WDRfnMax        EQU         -4096                    ; largest possible WDrefnum
  19. HFSTagData        EQU         $38A                    ; Room for additional HFS tag data
  20. FCBSPtr         EQU         $34E                    ; ptr to FCBs
  21. DefVCBPtr        EQU         $352                    ; pointer to default VCB
  22. VCBQHdr         EQU         $356                    ; VCB queue header
  23. FSQHdr            EQU         $360                    ; file system queue header (10 bytes)
  24. FSBusy            EQU         $360                    ; non-zero when the file system is busy
  25. FSQHead         EQU         $362                    ; ptr to 1st queued cmd: 0 when queue empty
  26. FSQTail         EQU         $366                    ; ptr to last queue element
  27.  
  28. ;;;
  29. ;;; HParamBlockRec Record
  30. ;;;
  31. HParamBlockRec    RECORD        0
  32. qLink            DS.L        1
  33. qType            DS.W        1
  34. ioTrap            DS.W        1
  35. ioCmdAddr        DS.L        1
  36. ioCompletion    DS.L        1
  37. ioResult        DS.W        1
  38. ioNamePtr        DS.L        1
  39. ioVRefNum        DS.W        1
  40.                 ENDR
  41.  
  42. ;;;
  43. ;;; HParamBlockRec.fileParam Record
  44. ;;;
  45. HFileParam        RECORD        24
  46. ioFRefNum        DS.W        1
  47. ioFVersNum        DS.B        1
  48. filler1         DS.B        1
  49. ioFDirIndex     DS.W        1
  50. ioFlAttrib        DS.B        1
  51. ioFlVersNum     DS.B        1
  52. ioFlFndrInfo    DS.L        4
  53. ioDirID         DS.L        1
  54. ioFlStBlk        DS.W        1
  55. ioFlLgLen        DS.L        1
  56. ioFlPyLen        DS.L        1
  57. ioFlRStBlk        DS.W        1
  58. ioFlRLgLen        DS.L        1
  59. ioFlRPyLen        DS.L        1
  60. ioFlCrDat        DS.L        1
  61. ioFlMdDat        DS.L        1
  62. HFileParamSize    EQU         *
  63.                 ENDR
  64.  
  65. ;
  66. ; Volume Control Block equates: (prefix: VCB)
  67. ;
  68. vcbFlags        EQU         6                        ; flags word is first word after header
  69. vcbDirty        EQU         15                        ; flags dirty bit (tst.w tests,clr.b clears)
  70. ; first 64/104 bytes of VCB come directly from the directory master block
  71. vcbDInfoSt        EQU         8                        ; leave room for 6-byte queue header
  72. vcbDILen        EQU         64                        ; len of VCB data from master directory (from old FSEQU)
  73. vcbSigWord        EQU         8                        ; signature word
  74. vcbCrDate        EQU         10                        ; Creation date.
  75. vcbLsBkUp        EQU         14                        ; last backup date
  76. vcbLsMod        EQU         14                        ; alternate name for above
  77. vcbAtrb         EQU         18                        ; volume attributes. bit 15 = vol lock (1=locked)
  78. ; bit 7 = wr protect
  79. ; bit 6 = busy (1=busy)
  80. ; bit 5 = volume consistent if set
  81. ; (set for default on GetVolInfo)
  82. ; bits 0-4 = consistency prob
  83. ; 0: max CNID > VCBNxtCNID
  84. ; 1: file count error
  85. ; 2: file length error
  86. ; 3: catalog B*-tree loop
  87. ; 4: extent B*-tree loop
  88. vcbAtVOK        EQU         8                        ; attrib consistent volume flag (set on clean _Unmount)
  89. ; (bit 8 in word, bit 0 in top byte)
  90. vcbWrProt        EQU         7                        ; attrib write-protected bit (tst.b ATRB+1 tests)
  91. vcbNmFls        EQU         20                        ; number files in MFS dir
  92. ; number files in HFS root dir
  93. vcbDirSt        EQU         22                        ; start dir (512-byte) block on diskette (MFS)
  94. vcbVBMSt        EQU         22                        ; same as VCBDirSt, starting block of allocation map (HFS) (overlaps)
  95. vcbBlLn         EQU         24                        ; length of dir in (512-byte) blocks (MFS)
  96. vcbAllocPtr     EQU         24                        ; same as VCBBlLn, Starting block for new file allocations
  97. vcbNmBlks        EQU         26                        ; number of blocks (of alloc size) this device
  98. vcbNmAlBlks     EQU         26                        ; (alternate label for a while)
  99. vcbAlBlkSiz     EQU         28                        ; num of bytes in an allocation block
  100. vcbClpSiz        EQU         32                        ; num of bytes to try to alloc as a clump
  101. vcbAlBlSt        EQU         36                        ; starting diskette (512-byte) block in block map
  102. vcbNxtCNID        EQU         38                        ; next free CNode identifier (HFS)
  103. vcbNxtFNum        EQU         38                        ; next free file number (MFS)
  104. vcbFreeBks        EQU         42                        ; number of free blocks on this volume
  105. vcbVN            EQU         44                        ; volume name (including name length byte)
  106. vcbMaxNam        EQU         27                        ; 27 byte max name length
  107. IOVDirLen        EQU         vcbVN-vcbCrDate         ; Length of info to copy by GetVolInfo
  108. ;
  109. ; next 6 fields should be kept together
  110. ;
  111. vcbDrvNum        EQU         72                        ; drive number for this VCB
  112. vcbDRefNum        EQU         74                        ; driver refnum for this VCB
  113. vcbFSID         EQU         76                        ; ID of file system handling this volume
  114. vcbVRefNum        EQU         78                        ; unique refnum for this VCB
  115. vcbMAdr         EQU         80                        ; volume map address (FS volume)
  116. vcbBufAdr        EQU         84                        ; volume buffer address
  117. vcbMLen         EQU         88                        ; length of volume map (FS volume)
  118. vcbDirIndex     EQU         90                        ; directory index, block number used for
  119. vcbDirBlk        EQU         92                        ; GetFileInfo searches by index
  120. MFSVCBLen        EQU         94                        ; Length of MFS VCB
  121. ;
  122. ; Volume Control Block (VCB) extensions for HFS copied from Volume Info Block:
  123. ;
  124. vcbTDInfoSt     EQU         94                        ; Start of additional HFS info:
  125. vcbVolBkUp        EQU         94                        ; Date volume was last backed up
  126. vcbVSeqNum        EQU         98                        ; Index of volume in backup set
  127. vcbWrCnt        EQU         100                     ; Volume write count
  128. vcbXTClpSiz     EQU         104                     ; Extent B*-Tree clump size
  129. vcbCTClpSiz     EQU         108                     ; Catalog B*-Tree clump size
  130. vcbNmRtDirs     EQU         112                     ; Number of directories in root
  131. vcbFilCnt        EQU         114                     ; Total number of files in volume
  132. vcbDirCnt        EQU         118                     ; Total number of directories in volume
  133. vcbFndrInfo     EQU         122                     ; Finder info for volume
  134. vcbVCSize        EQU         154                     ; Volume cache size in blocks
  135. vcbVBMCSiz        EQU         156                     ; Bitmap cache size in blocks
  136. vcbCtlCSiz        EQU         158                     ; Extent and Catalog B*-Tree cache size (blocks)
  137. ;
  138. ; additional VCB information NOT copied from the MDB:
  139. ;
  140. vcbXTAlBks        EQU         160                     ; Size of extent B*-Tree in allocation blocks
  141. vcbCTAlBks        EQU         162                     ; Size of catalog B*-Tree in allocation blocks
  142. vcbXTRef        EQU         164                     ; File RefNum for Extent B*-Tree
  143. vcbCTRef        EQU         166                     ; File RefNum for Catalog B*-Tree
  144. vcbCtlBuf        EQU         168                     ; Pointer to extent desc. and catalog caches
  145. vcbDirIDM        EQU         172                     ; Directory last searched: 0 if invalid.
  146. vcbOffsM        EQU         176                     ; Offspring index at last search
  147. vcbLength        EQU         178                     ; VCB byte length
  148. ; File Control Block equates: (prefix: FCB)
  149. fcbModBit        EQU         7                        ; dirty bit for FCB entry in FCBMdRByt
  150. fcbOwnClp        EQU         6                        ; Clump-size specified flag (for truncate on close)
  151. fcbFilLck        EQU         5                        ; 1 if file is locked [write-protected] 
  152. fcbShrWrt        EQU         4                        ; 1 if file is open for shared write access 
  153. fcbWrtLck        EQU         2                        ; 1 if fork is reserved for write (byte range lock)
  154. fcbRscBit        EQU         1                        ; 1 if this is resource part (in FCBMdRByt)
  155. fcbWrtBit        EQU         0                        ; write permissions bit in FCBTypByt (1 if ok)
  156. fcbFlgMBit        EQU         15                        ; dirty bit in FCBFlags (word)
  157. fcbFlgCBit        EQU         14                        ; clump-size spec'd bit in FCBFlags (word)
  158. fcbFlgPBit        EQU         13                        ; Write-protected [file lock] bit in FCBFlags (word)
  159. fcbFlgSBit        EQU         12                        ; Shared-write bit in FCBFlags (word)
  160. fcbFlgLBit        EQU         10                        ; Byte range locked bit in FCBFlags (word)
  161. fcbFlgRBit        EQU         9                        ; resource bit in FCBFlags (word)
  162. fcbFlgWBit        EQU         8                        ; write permissions bit in FCBFlags (word)
  163. WrRsMask        EQU         $0300                    ; rsrc/reg, write permissions mask
  164. PermMask        EQU         $1300                    ; all bits related to access arbitration
  165. fcbFlNm         EQU         0                        ; FCB file number. Non-zero marks FCB used.
  166. fcbFlags        EQU         4                        ; FCB flags
  167. fcbMdRByt        EQU         4                        ; mod, write permissions, resource byte
  168. fcbTypByt        EQU         5                        ; type byte
  169. fcbSBlk         EQU         6                        ; File start block (in alloc size blks)
  170. fcbEOF            EQU         8                        ; logical length or EOF in bytes
  171. fcbPLen         EQU         12                        ; Physical file length in bytes
  172. fcbCrPs         EQU         16                        ; current position within file.
  173. ioFIStILen        EQU         20                        ; Length to straight copy from FCB on _GetFCBInfo
  174. fcbVPtr         EQU         20                        ; Absolute pointer to the corresponding VCB
  175. fcbBfAdr        EQU         24                        ; file's buffer address.
  176. fcbFlPos        EQU         28                        ; directory block this file is in
  177. MFSFCBLen        EQU         30                        ; Length of MFS FCB structure
  178. ;
  179. ; FCB Extensions for HFS:
  180. ;
  181. fcbClmpSize     EQU         30                        ; Number of bytes per clump
  182. fcbBTCBPtr        EQU         34                        ; pointer to B*-Tree control block for this file
  183. fcbExtRec        EQU         38                        ; First 3 file extents
  184. fcbFType        EQU         50                        ; file's 4 Finder Type bytes
  185. fcbCatPos        EQU         54                        ; Catalog hint for use on Close
  186. fcbDirID        EQU         58                        ; Parent Directory ID
  187. fcbCName        EQU         62                        ; CName of open file
  188. fcbEntLen        EQU         94                        ; Length of each element in the FCB array
  189. ;_______________________________________________________________________
  190. ;
  191. ; Directory master block entries: (Prefix Dr)
  192. ;
  193. drSigWord        EQU         0                        ; signature word
  194. drCrDate        EQU         2                        ; Creation date.
  195. drLsMod         EQU         6                        ; last backup date
  196. drAtrb            EQU         10                        ; volume attributes. bit 15=write(locked=1)
  197. drNmFls         EQU         12                        ; number files in directory
  198. drDirSt         EQU         14                        ; start dir (512-byte) block on diskette
  199. drVBMSt         EQU         14                        ; starting sector of allocation map (overlaps)
  200. drBlLn            EQU         16                        ; length of dir in (512-byte) blocks
  201. drAllocPtr        EQU         16                        ; Start of next allocation search
  202. drNmAlBlks        EQU         18                        ; number of blocks (of alloc size) this volume
  203. drAlBlkSiz        EQU         20                        ; min num of bytes to allocate (must be 512 mult)
  204. drClpSiz        EQU         24                        ; num of bytes to try to alloc as a clump
  205. drAlBlSt        EQU         28                        ; starting diskette (512-byte) block in block map
  206. drNxtCNID        EQU         30                        ; Next CNode identifier
  207. drNxtFNum        EQU         30                        ; next free file number
  208. drFreeBks        EQU         34                        ; number of free blocks on this volume
  209. drVN            EQU         36                        ; volume name (including name length)
  210. MpTblStr        EQU         64                        ; byte start position of map table within
  211. ; master dir block (MFS volume)
  212. ;
  213. ; Master Directory Block extensions for HFS:
  214. ;
  215. drTInfoSt        EQU         64
  216. drVolBkup        EQU         64                        ; Date of last volume backup (overlaps)
  217. drVSeqNum        EQU         68                        ; Sequence number of volume within backup set
  218. drWrCnt         EQU         70                        ; Volume write count
  219. drXTClpSiz        EQU         74                        ; Extent B*-Tree clump size
  220. drCTClpSiz        EQU         78                        ; Catalog B*-Tree clump size
  221. drNmRtDirs        EQU         82                        ; Number of subdirectories in the root
  222. drFilCnt        EQU         84                        ; Total number of files in volume
  223. drDirCnt        EQU         88                        ; Total number of directories in volume
  224. drFndrInfo        EQU         92                        ; Finder info for volume
  225. drVCSize        EQU         124                     ; Volume cache size
  226. drVBMCSize        EQU         126                     ; Volume Bitmap cache size
  227. drCtlCSize        EQU         128                     ; Size of common volume cache
  228. ;
  229. ; length of additional VCB data from master directory block for HFS volumes:
  230. ;
  231. vcbTDILen        EQU         130-drTInfoSt
  232. ;
  233. ; Information not copied into VCB:
  234. ;
  235. drXTFlSize        EQU         130                     ; Length of extent B*-Tree (LEOF and PEOF)
  236. drXTExtRec        EQU         134                     ; First (and only) extent-tree extent record
  237. drCTFlSize        EQU         146                     ; Length of catalog B*-Tree (LEOF and PEOF)
  238. drCTExtRec        EQU         150                     ; First catalog extent record
  239. LenMDB            EQU         162                     ; length of full MDB
  240. drUsrInfo        EQU         256                     ; User information for volume
  241. ;_______________________________________________________________________
  242. ;
  243. ; File Entry equates: (prefix: Fl)
  244. ; (delete indication may be needed; for now just check VCB del fnum . . .)
  245. flWrtFlag        EQU         0                        ; write-allowed bit in flags byte (0 if allowed)
  246. flTypMask        EQU         $FE                     ; (user file-type in bits 1-7)
  247. flFlags         EQU         0                        ; bit 7=1 (used), bit 0=file lock flag
  248. flTyp            EQU         1                        ; file type (used as a name extension)
  249. flUsrWds        EQU         2                        ; user words for file. (16 bytes)
  250. flFlNum         EQU         18                        ; file number
  251. flStBlk         EQU         22                        ; Start file block (alloc blk size)(0000 if none)
  252. flLgLen         EQU         24                        ; File logical length in bytes (EOF)
  253. flPyLen         EQU         28                        ; File physical length in bytes
  254. flRStBlk        EQU         32                        ; Start file block, resource fork (0000 if none)
  255. flRLgLen        EQU         34                        ; File logical length (EOF), resource fork
  256. flRPyLen        EQU         38                        ; File physical length, resource fork
  257. flCrDat         EQU         42                        ; File creation date & time (32 bits in seconds)
  258. flMdDat         EQU         46                        ; last modification date & time (32 bits in seconds)
  259. flNam            EQU         50                        ; file name, starting with length byte
  260. flNTLen         EQU         50                        ; length of each file entry, excluding name
  261. ;_______________________________________________________________________
  262. ;
  263. ; Working Directory Control Block equates: (prefix: WD)
  264. ;
  265. WDVCBPtr        EQU         0                        ; pointer to VCB of residing WD (longint)
  266. WDDirID         EQU         4                        ; WD directory Identification (longint)
  267. WDCatHint        EQU         8                        ; Catalog node hint
  268. WDProcID        EQU         12                        ; process that created WD
  269. WDCBLen         EQU         16                        ; Length of a WDCB
  270. ;_______________________________________________________________________
  271. ;
  272. ; Poor Man's Search Path equates: (prefix: SP)
  273. ;
  274. PMSPHook        EQU         -6                        ; Hook for PMSP modification
  275. PMSPIndx        EQU         -2                        ; Index to PMSP index from start of PMSP
  276. SPHdrSize        EQU         6                        ; Size of negative-offset header
  277. SPVRefNum        EQU         0                        ; Offset to VRefNum in PMSP entry
  278. SPDirID         EQU         2                        ; Offset to Directory ID in PMSP entry
  279. SPEntLen        EQU         6                        ; Length of a PMSP entry
  280. MaxDVCnt        EQU         8                        ; Leave room for 8 default VRefNums
  281. PMSPSize        EQU         MaxDVCnt*SPEntLen+SPHdrSize+2
  282.                                                         ; Size of PMSP table +header + index word
  283. ; 31744 = $7C00, a nice round number close to
  284. ; (32767*1000)/1024, which is about the largest 
  285. ; free space unsuspecting, decimal-K minded apps
  286. ; might be expected to handle.
  287. AlBlkLim        EQU         31744
  288.